home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d18
/
boost4.arc
/
HEAPER.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-10-23
|
1KB
|
44 lines
Program Heaper;
{ Demonstrates moving a box nondestructively over a screen }
uses crt,BOSHARE;
var
i,x1,y1,Ecode : integer;
page : array[1..2] of HeapBuf;
begin
{ -- Set up 2 pages on heap -- }
Mark(HeapTop);
New(page[1]);
New(page[2]);
ClrScr;
SaveScreen ( Page[1] );
BoxHeap ( Page[1], 1,1, 20, 10, 1, 14 ); { build a box }
HeapAtt ( Page[1], 1, 1, 20, 10, 112 ); { add fill }
{ -- Read in a ScrGen HELP screen -- }
Fil2Heap('Help16.Gen',1,1,Page[2],Ecode );
if Ecode <> 0 then begin
Write('Help16.Gen not found.');
exit;
end;
RestoreScreen ( Page[2] );
{ -- Flash a box over the HELP screen until a keypress -- }
repeat
x1 := 1 + random(59);
y1 := 1 + random(16);
{ Show the box }
Heap2Scr ( Page[1],1,1,20,10,x1,y1);
delay(50);
{ Restore the portion that the box erased }
Heap2Scr ( Page[2],x1,y1,x1+19,y1+9,x1,y1 );
until Keypressed;
Release(HeapTop);
end.